#include <iostream>
#include <math.h>
using namespace std;

int main()
{	int size=10;
	int alist[10];
	int temp;
	//fill list randomly
	for(int i=0; i<size; i++)
	{
		alist[i]=rand()%10;
	}
	cout<<"Randomized array with size:: "<<size<<"\n";
	for(int i=0; i<size; i++)
	{
		
	cout<<alist[i];	
	cout<<" ";
	}
	cout<<"\n";

	cout<<"Bubble-sorting with size:: "<<size<<"...\n";
	//bubble sort
	for(int j=0; j<size; j++)
	{
		for(int i=size-1; i>0; i--)
		{

			if(alist[i]<alist[i-1])
				{
				temp=alist[i];
				alist[i]=alist[i-1];
				alist[i-1]=temp;
				}

		}
	}
	
	cout<<"Done sorting array with size:: "<<size<<"!\n";
	for(int i=0; i<size; i++)
	{
	
		cout<<alist[i];
	cout<<" ";
	}
	cout<<"\n";

	system("pause");
	return 0;
}